{% extends "base_posten.html" %}

{% block content %}
<form id="myform" name="myform" action="" method="POST">
<table class="list">
  <tr>
    <th class="posten">Posten</th>
    <th>Art</th>
    <th>Reihenfolge</th>
  </tr>
  {% for p in posten %}
  <tr class="{% cycle 'odd' 'even' as rowcolors %}">
    <td class="posten"><a href="{% url posten_get wettkampf.jahr, wettkampf.name, disziplin.name, p.name %}">{{ p.name}}</a>
    <td>
      {{ p.postenart }}
      {% if p.postenart.name == 'Zeitnote' %}
      <a href="{% url richtzeit wettkampf.jahr, wettkampf.name, disziplin.name, p.name %}">(Richtzeit)</a>
      {% endif %}
    </td>
    <td>{{ p.reihenfolge }}</td>
  </tr>
  {% endfor %}
  {% if form.non_field_errors %}
  <tr><td colspan="3">{{ form.non_field_errors }}</td></tr>
  {% endif %}
  <tr>
    <td>{{ form.name.errors }}{{ form.name }}</td>
    <td>{{ form.postenart.errors }}{{ form.postenart }}</td>
    <td><input type="submit" value="Posten hinzufügen"/></td>
  </tr>
</table>
</form>
{% endblock %}
